﻿@model Company

<div class="card shadow border-0 my-4">
    <div class="card-header bg-secondary bg-gradient m-lg-0 py-3">
        <div class="row">
            <div class="col-12 text-center">
                <h2 class="text-white py-2">@(Model.Id != 0 ? "Update" : "Create") Company</h2>
            </div>
        </div>
    </div>

    <div class="card-body p-4">
        <form method="post" class="row" enctype="multipart/form-data">
            <input asp-for="Id" hidden />

            <div class="row">
                <div class="col-12">
                    <div class="border p-3">
                        <div class="form-floating py-2 col-12">
                            <input asp-for="Name" class="form-control border-0 shadow" />
                            <label asp-for="Name" class="ms-2"></label>

                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>

                        <div class="form-floating py-2 col-12">
                            <label asp-for="PhoneNumber" class="ms-2 text-muted"></label>
                            <input asp-for="PhoneNumber" class="form-control border-0 shadow"/>
                            <span asp-validation-for="PhoneNumber" class="text-danger"></span>
                        </div>

                        <div class="form-floating py-2 col-12">
                            <label asp-for="StreetAddress" class="ms-2 text-muted"></label>
                            <input asp-for="StreetAddress" class="form-control border-0 shadow"/>
                            <span asp-validation-for="StreetAddress" class="text-danger"></span>
                        </div>

                        <div class="form-floating py-2 col-12">
                            <label asp-for="City" class="ms-2 text-muted"></label>
                            <input asp-for="City" class="form-control border-0 shadow"/>
                            <span asp-validation-for="City" class="text-danger"></span>
                        </div>

                        <div class="form-floating py-2 col-12">
                            <label asp-for="State" class="ms-2 text-muted"></label>
                            <input asp-for="State" class="form-control border-0 shadow"/>
                            <span asp-validation-for="State" class="text-danger"></span>
                        </div>

                        <div class="form-floating py-2 col-12">
                            <label asp-for="PostalCode" class="ms-2 text-muted"></label>
                            <input asp-for="PostalCode" class="form-control border-0 shadow"/>
                            <span asp-validation-for="PostalCode" class="text-danger"></span>
                        </div>


                        <div class="row pt-2">
                            <div class="col-6 col-md-3">
                                @if (Model.Id != 0)
                                {
                                    <button type="submit" class="btn btn-primary form-control">Update</button>
                                }
                                else
                                {
                                    <button type="submit" class="btn btn-primary form-control">Create</button>
                                }
                            </div>
                            <div class="col-6 col-md-3">
                                <a asp-controller="Company" asp-action="Index" class="btn btn-outline-primary border form-control">Back To List</a>
                            </div>
                        </div>
                    </div>
                </div>                
            </div>
        </form>

    </div>
</div>



@section Scripts {
    <script>
        tinymce.init({
            selector: 'textarea',
            plugins: 'anchor autolink charmap codesample emoticons  lists   table visualblocks wordcount',
            toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough |  align lineheight | numlist bullist indent outdent',
        });
    </script>
    @{
        <partial name="_ValidationScriptsPartial" />
    }
}